package com.atguigu.service.impl;

import com.atguigu.mapper.UserMapper;
import com.atguigu.pojo.User;
import com.atguigu.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;
    @Value("${server.port}")
    private Integer port;
    @Override
    public User getUserById(int id) {
        User user = userMapper.selectByPrimaryKey(id);
        user.setAddress(user.getAddress()+"--->"+port);
        return user;
    }
}
